package com.hsgene.basic.dto;

import java.io.Serializable;
import java.util.List;

/**
 * @author wangbing
 * @version 1.0, 2018/8/10
 */
public class AreaDto implements Serializable, Comparable<AreaDto> {

    private static final long serialVersionUID = 1823018568120356137L;

    /**
     * 区域id
     */
    private Long id;

    /**
     * 区域名称
     */
    private String name;

    /**
     * 区域等级
     */
    private Integer level;

    /**
     * 父级区域信息
     */
    private AreaDto parent;

    /**
     * 所有直接下级区域
     */
    private List<AreaDto> children;

    @Override
    public int compareTo(AreaDto o) {
        if (o == null || this.id == null || o.getId() == null) {
            return 0;
        }
        return this.id.compareTo(o.getId());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public AreaDto getParent() {
        return parent;
    }

    public void setParent(AreaDto parent) {
        this.parent = parent;
    }

    public List<AreaDto> getChildren() {
        return children;
    }

    public void setChildren(List<AreaDto> children) {
        this.children = children;
    }
}
